﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace TrainningCompany.Controllers
{
	/// <summary>
	/// Classe que representará as operações possíveis para a entidade Courses
	/// </summary>
	public class CoursesController : ApiController
	{
		static List<course> courses = InitCourses();

		private static List<course> InitCourses()
		{
			var ret = new List<course>();
			ret.Add( new course
			{
				id = 0,
				title = "Web API"
			} );

			ret.Add( new course
			{
				id = 1,
				title = "Mobile Apps"
			} );

			return ret;
		}
		
		public IEnumerable<course> Get()
		{
			
			return courses;
		}
	}

	public class course // Convenção Json
	{
		public int id;
		public string title;
	}
}
